package com.base.service;

import java.sql.Timestamp;
import java.util.*;

import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.CriteriaSpecification;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.ProjectionList;
import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Property;
import org.hibernate.criterion.Restrictions;
import org.hibernate.type.StringType;
import org.hibernate.type.Type;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

import tool.ClientTool;
import tool.JsonTool;
import tool.TimeTool;

import com.base.bean.*;
import com.base.dao.*;
import com.base.domain.*;

/**
 * 
 * @author Administrator
 * 
 */

public class JUserService {

	// 单例模式 start
	private volatile static JUserService instance = null;
	private JUserDao juserDao;


	private JUserService() {
		juserDao = (JUserDao) _BaseDao.ac.getBean("JUserDao");
	
	}

	public static JUserService getInstance() {
		if (instance == null) {
			synchronized (JUserService.class) {// 1
				if (instance == null) {// 2
					instance = new JUserService();// 3
				}
			}
		}
		return instance;
	}

	// 单例模式 end
	
//	public boolean refreshAccessToken(String openId,String accessToken){
//		
//		
//		return true;
//	}

	 
	
	

	// TEST
	public static void main(String[] args) throws Exception {
		JUserService us=JUserService.getInstance();
		

	}

	public JUserDao getJuserDao() {
		return juserDao;
	}

	

}
